DEBUG=-g
PAL_DIR=/proj/pal/pal/pal
PAL_OPTS=-I${PAL_DIR} -I${PAL_DIR}/pal/ -L/usr/local/lib/ -lpal
QT_OPTS = -I/usr/include/qt4/QtCore -I/usr/include/qt4 -lQtCore 
all: buildfiles plugin.so

buildfiles: 
	./rebuildfactories.sh

plugin.so: buildrobots
	g++ $(DEBUG) -shared -Wl,-soname,plugin.so -o plugin.so objects/*.o -lc

buildrobots:
	g++ $(DEBUG) -c ${PAL_OPTS} -I../common/ -fPIC robots/*.cpp obstacles/*.cpp  ../common/ElementData.cpp ObstacleFactoryImpl.cpp RobotFactoryImpl.cpp plugin.cpp
	mv *.o objects/

clean:
	rm RobotFactoryImpl.cpp ObstacleFactoryImpl.cpp plugin.so objects/*

re: clean all


.PHONY: all re clean rebuildfactories buildrobots buildfiles
